#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
//有序序列判断
int main()
{
	int n = 0;
	scanf("%d", &n);
	int arr[1000] = { 0 };
	int i = 0;
	for (i = 0; i < n; i++)
	{
		scanf("%d", &arr[i]);
	}
	int count1 = 0;
	int count2 = 0;
	for (i = 0; i < n - 1; i++)
	{
		if (arr[i] >= arr[i + 1])
			count1++;
		else if(arr[i] < arr[i + 1])
			count2++;
		
	}
	if (count1==n-1||count2==n-1)
	{
		printf("sorted");
	}
	else
		printf("unsorted");
	return 0;
}